--- js.orig/src/Makefile.ref	2006-07-26 20:16:47.000000000 +0100
+++ js/src/Makefile.ref	2009-01-03 19:05:28.000000000 +0000
@@ -335,8 +335,8 @@
 $(PROGRAM): $(PROG_OBJS) $(LIBRARY)
 	link.exe -out:"$@" $(EXE_LINK_FLAGS) $^
 else
-$(PROGRAM): $(PROG_OBJS) $(LIBRARY)
-	$(CC) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) $(OTHER_LIBS) \
+$(PROGRAM): $(PROG_OBJS) $(SHARED_LIBRARY)
+	$(CC) -o $@ $(CFLAGS) $(PROG_OBJS) $(LIBRARY) $(LDFLAGS) -L$(OBJDIR) -ljs $(OTHER_LIBS) \
 	    $(PROG_LIBS)
 endif
 
